As to a master cylinder unit to be used in a brake system for a vehicle (a brake hydraulic device for a vehicle), there exists a device including a master cylinder which converts an input to a brake operation element into the brake hydraulic pressure, an electromagnetic valve for opening and closing a hydraulic pressure path disposed in a base body of the master cylinder, an electromagnetic coil fitted on the outer surface of the electromagnetic valve, and a housing having a housing chamber for accommodating the electromagnetic valve and the electromagnetic coil (for example, refer to the patent document 1).